package br.jcrsistemas.database;

import java.sql.SQLException;

import java.sql.PreparedStatement;

import br.jcrsistemas.util.Util;

public class TesteBanco {
	public static void main(String[] args) {
		Conexao conn = ConexaoFactory.getConnectionFactory();
		String query = "INSERT INTO categoria(categoria) VALUES (?)";
		try {
			conn.iniciaTransacao();
			PreparedStatement ps = conn.getConnection().prepareStatement(query);
			ps.setString(1, "TESTE-ROLLBACK");
			ps.execute();
			int a = Integer.parseInt("A");
			conn.commit();
			conn.encerraTransacao();
			
		} catch (Exception e) {
			conn.rollback();
			e.printStackTrace();
		}
	
	}

}
